﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace parking
{


    public class AdminImpl
    {
        static dbDataContext db = new dbDataContext();

        internal static bool blockSpot(int spotId)
        {
            //get the spot
            spot mySpot = db.spots.Single(s => s.spotId == spotId);

            //change the status
            mySpot.status = "blocked";
            db.SubmitChanges();

            return true;
        }

        internal static bool unblockSpot(int spotId)
        {
            //get the spot
            spot mySpot = db.spots.Single(s => s.spotId == spotId);

            //change the status
            mySpot.status = "available";
            db.SubmitChanges();

            return true;
        }
    
    }
}